﻿
    using WCYCReader.Models;
    using System;
    using System.Collections.ObjectModel;
namespace WCYCReader.ViewModels
{
    public class NewOriginalBookList_VM
    {
        private ObservableCollection<BookList_M> _T_NewOriginalBookList;

        public void SetNewOriginalBookList(JsonData blm)
        {
            foreach (BookListJsonData data in blm.value.record)
            {
                BookList_M item = new BookList_M {
                    str_Author_M = "作者：" + data.author,
                    str_Category_M = data.category,
                    str_CategoryName_M = "分类：" + data.categoryName,
                    str_Cover_M = (data.cover == "http://wfqqreader.3g.qq.com/cover/b_default.jpg") ? "/Resource/DefaultBookBackground.jpg" : data.cover,
                    str_DownUrl_M = data.downUrl,
                    str_Finished_M = data.finished,
                    str_Free_M = data.free,
                    str_HotValue_M = data.hotValue,
                    str_Size_M = "大小：" + data.size + "KB",
                    str_Id_M = data.id,
                    str_Intro_M = data.intro,
                    str_Title_M = data.title,
                    str_TotalWords_M = data.totalWords,
                    str_Type_M = data.type,
                    str_Copyright_M = data.copyright
                };
                this.T_NewOriginalBookList_VM().Add(item);
            }
        }

        public ObservableCollection<BookList_M> T_NewOriginalBookList_VM()
        {
            if (this._T_NewOriginalBookList == null)
            {
                this._T_NewOriginalBookList = new ObservableCollection<BookList_M>();
            }
            return this._T_NewOriginalBookList;
        }
    }
}

